<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>unique</title>
    <link rel="stylesheet" href="css/styles.css">
    <link type="text/css" href="css/css.css" rel="stylesheet" />
    <script type="text/javascript" src="js/js/jquery-1.9.1.min.js"></script>
    <script type="text/javascript" src="js/js.js"></script>

</head>

<body>
<header id="header">
    <jsp:include page="head.jsp"/>
</header>

<div id="headline">
    <img src="img/headline.jpg" alt="">
    <hgroup>
        <h2>机票订购</h2>
        <h3>机票、火车票、轮船票等各种票务订购的服务</h3>
    </hgroup>
</div>


<div class="car">
    <div class="cont">
        <div class="carImg"><img src="images/car1.jpg" width="951" height="27" /></div>


        <table class="orderList">
            <tr>
                <th width="20"></th>
                <th width="145">线路</th>
                <th width="145">时间</th>
                <th width="130">价格</th>
                <th width="105">操作</th>

            </tr>
            <c:set value="0" var="total"></c:set>
            <c:forEach items="${tickets}" var="order">
                <tr>
                    <td></td>
                    <td>
                        <dl>
                            <input type="hidden" name="id" value="${order.id}" id="idd">
                            <dd>${order.airTicket.origin}--${order.airTicket.destination}<br /></dd>
                            <div class="clears"></div>
                        </dl>
                    </td>
                    <td><strong class="red">

                                <fmt:formatDate value="${order.airTicket.departDate}" pattern="yyyy-MM-dd HH:mm"/>

                    </strong></td>
                    <td><strong class="red">￥${order.airTicket.price}</strong></td>

                    <td>
                            <%--<input type="hidden" id="idd" value="${order.id}">--%>
                        <a href="delectTicket.html?id=${order.id}" class="green" onclick="de()">删除</a>
                    </td>
                    <c:set value="${total+order.airTicket.price }" var="total"></c:set>
                </tr>
            </c:forEach>
        </table><!--orderList/-->
        <div class="zongji">
            <strong>总计：</strong><strong class="red">￥${total}</strong>
        </div>
        <div class="jiesuan">
            <a href="#" class="jie_2" onclick="cl()">立即结算&gt;&gt;</a>
            <div class="clears"></div>
        </div><!--jiesuan/-->
        <script>
            function cl() {
                var id=$("#idd").val();
                alert(id);
                location.href="updateTicket.html?id="+id;
            }
        </script>
        <div class="clears"></div>
    </div><!--cont/-->
</div><!--car/-->
<footer id="footer">
    <jsp:include page="below.jsp"/>
</footer>
</body>
</html>